#ifndef ObjectWriter_H
#define ObjectWriter_H
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<vector>
#include"HashMap.h"
using namespace std;

class ObjectWriter{
private:
	FILE* out;
public:
	ObjectWriter(const char* file);
	~ObjectWriter();
	void writeInt(int n);
	void writeBool(bool b);
	
	template<class T> inline void writeArray(T *v, int size){
		writeInt(size);
		fwrite(v, sizeof(T), size, out);
	}
	
	void writeVector(vector<int> &v);

	void writeString(string* str);
	void writeVector(vector<string*> &v);
	void writeVector(vector<vector<string*>*> &v);
	void writeMap(HashMap &Map);
};
#endif
